//
//  NativeBleScanChannel.m
//  kq_flutter_core_widget
//
//  Created by wtb on 2024/1/26.
//

#import "NativeBleScanChannel.h"

@implementation NativeBleScanChannel
#pragma mark 创建蓝牙扫描通道对象
+(NativeBleScanChannel *)registerStateWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar{
    FlutterEventChannel *scanChannel = [FlutterEventChannel eventChannelWithName:@"flutter.keqiang.com/bleScanEvent" binaryMessenger:[registrar messenger]];
    NativeBleScanChannel *scan = [[NativeBleScanChannel alloc] init];
    [scanChannel setStreamHandler:scan];
    return scan;
}

- (FlutterError * _Nullable)onCancelWithArguments:(id _Nullable)arguments {
    self.eventSink = nil;
    return nil;
}

- (FlutterError * _Nullable)onListenWithArguments:(id _Nullable)arguments eventSink:(nonnull FlutterEventSink)events {
    self.eventSink = events;
    return nil;
}
@end
